package com.training1.core.dto;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@SuppressWarnings("unused")
public class SystemTimeSettingParamDto {
	public static final String SYSTEM_LOGIN_BEGIN_TIME_KEY = "SYSTEM_RUN_BEGIN";
	public static final String SYSTEM_LOGIN_END_TIME_KEY  = "SYSTEM_RUN_END";
	public static final String CLIENT_DATE = "CLIENT_DATE";
	
	private static final String REG_EXP_DATE = "^((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))\\s+([0-1]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$";//"yyy-MM-dd hh:mm:ss" 
	
	private static final String REG_EXP_DATETIME = "^([0-1]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$";//"hh:mm:ss
	
	@NotNull(message="{module.systemtimeparamdto.loginBeginTime.notnull}")	
	@Pattern(regexp=REG_EXP_DATETIME,message="{module.systemtimeparamdto.loginBeginTime.error}")
	private String loginBeginTime;
	@NotNull(message="{module.systemtimeparamdto.loginEndTime.notnull}")
	@Pattern(regexp=REG_EXP_DATETIME,message="{module.systemtimeparamdto.loginEndTime.error}")
	private String loginEndTime;
	private String loginBeginTimeKey;
	private String loginEndTimeKey;
	@NotNull(message="{module.systemtimeparamdto.clientDate.notnull}")
	private String clientDate;
	private String clientDateKey;
	public String getClientDate() {
		return clientDate;
	}
	public void setClientDate(String clientDate) {
		this.clientDate = clientDate;
	}
	public String getClientDateKey() {
		if(clientDateKey==null){
			return CLIENT_DATE;
		}
		return clientDateKey;
	}
	public void setClientDateKey(String clientDateKey) {
		this.clientDateKey = clientDateKey;
	}
	public String getLoginBeginTime() {
		return loginBeginTime;
	}
	public void setLoginBeginTime(String loginBeginTime) {
		this.loginBeginTime = loginBeginTime;
	}
	public String getLoginEndTime() {
		return loginEndTime;
	}
	public void setLoginEndTime(String loginEndTime) {
		this.loginEndTime = loginEndTime;
	}
	public String getLoginBeginTimeKey() {
		if(loginBeginTimeKey==null){
			return SYSTEM_LOGIN_BEGIN_TIME_KEY;
		}
		return loginBeginTimeKey;
	}
	public void setLoginBeginTimeKey(String loginBeginTimeKey) {
		this.loginBeginTimeKey = loginBeginTimeKey;
	}
	public String getLoginEndTimeKey() {
		if(loginEndTimeKey==null){
			return SYSTEM_LOGIN_END_TIME_KEY;
		}
		return loginEndTimeKey;
	}
	public void setLoginEndTimeKey(String loginEndTimeKey) {
		this.loginEndTimeKey = loginEndTimeKey;
	}

}
